package com.hetaozi.login.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.hetaozi.login.entity.SysUserRole;
import com.hetaozi.login.mapper.SysUserRoleMapper;
import com.hetaozi.login.service.SysUserRoleService;
  /**
     * @email： wf520200@163.com
     * @date: 2021/11/11 15:51
     * 功能：
     * 描述：
     * @author： 吴帆
     **/
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements SysUserRoleService{

    @Override
    public int updateBatch(List<SysUserRole> list) {
        return baseMapper.updateBatch(list);
    }
    @Override
    public int batchInsert(List<SysUserRole> list) {
        return baseMapper.batchInsert(list);
    }
    @Override
    public int insertOrUpdate(SysUserRole record) {
        return baseMapper.insertOrUpdate(record);
    }
    @Override
    public int insertOrUpdateSelective(SysUserRole record) {
        return baseMapper.insertOrUpdateSelective(record);
    }

      @Override
      public List<SysUserRole> getListRoleByUserId(Long id) {
          QueryWrapper<SysUserRole> wrapper=new QueryWrapper<>();
          wrapper.eq("user_id",id);
          return baseMapper.selectList(wrapper);
      }
  }
